﻿<table id='afficher_demande' border="1">
	<thead>
		<tr>
			<th>ID</th>
			<th>Numéro de courrier</th>
			<th>Déposé par</th>
			<th>Date</th>
			<th>Etat</th>
			<th>Type</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><?php echo $this->escape($this->afficher_demande->Id_demande);?></td>
			<td><?php echo $this->escape($this->afficher_demande->Id_courrier);?></td>
			<td><?php echo $this->escape($this->afficher_demande->Id_utilisateur);?></td>
			<td><?php echo $this->escape($this->afficher_demande->Date_demande);?></td>
			<td><?php
					$etat = $this->escape($this->afficher_demande->Etat);
						  if($etat == 0){echo "<span style='color:red' >En attente</span>";}
						  elseif ($etat == 1){echo "<span style='color:orange' >En cours</span>";}
						  else {echo "<span style='color:green' >Traité</span>";}
				?></td>
			<td><?php echo $this->escape($this->afficher_demande->Type);?></td>
		</tr>
	</tbody>
</table>

<br />


<?php
$auth=Zend_Auth::getInstance();
$profil = $auth->getIdentity();   
$droits = $profil->Droits;

if($droits == 3)
	{
		echo $this->action('modifier-etat-demande', 'Demande', null, array('id' => ($this->afficher_demande->Id_demande)));
	}

?>

<br />

<table id='afficher_demande_commentaire' >
	<thead>
		<tr>
			<th>Commentaire sur la demande</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><?php echo $this->escape($this->afficher_demande->Commentaires);?></td>
		</tr>
	</tbody>	
</table>
	
	

<script type="text/javascript"> 
	$(function () {
		tableToGrid("#afficher_demande", {height:"auto", caption: "Informations sur la demande"});
		tableToGrid("#afficher_demande_commentaire", {height:"auto"});
	});
</script>